<?php

use app\admin\Service;
use think\admin\extend\PhinxExtend;
use think\admin\model\SystemSites;
use think\migration\Migrator;

@set_time_limit(0);
@ini_set('memory_limit', -1);

/**
 * 系统模块初始化
 */
class InsertSites extends Migrator
{
    /**
     * 数据库初始化
     * @return void
     */
    public function change()
    {
        $this->insertSites();
    }

    /**
     * 初始化站点数据
     * @return void
     */
    private function insertSites()
    {
        $model = SystemSites::mk()->whereRaw('1=1')->findOrEmpty();
        $model->isEmpty() && $model->saveAll([
          [
            'site_name' => '象站',
            'site_url' => 'https://ptvicomo.net',
            'api_url' => 'https://ptvicomo.net/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '铃音',
            'site_url' => 'https://pt.soulvoice.club',
            'api_url' => 'https://pt.soulvoice.club/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => 'carpt',
            'site_url' => 'https://carpt.net',
            'api_url' => 'https://carpt.net/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '蚂蚁',
            'site_url' => 'http://hdmayi.com',
            'api_url' => 'http://hdmayi.com/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '蝶粉',
            'site_url' => 'https://discfan.net',
            'api_url' => 'https://discfan.net/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => 'ilolicon',
            'site_url' => 'https://share.ilolicon.com',
            'api_url' => 'https://share.ilolicon.com/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '大青虫',
            'site_url' => 'https://cyanbug.net',
            'api_url' => 'https://cyanbug.net/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '3wmg',
            'site_url' => 'https://www.3wmg.com',
            'api_url' => 'https://www.3wmg.com/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '阿童木',
            'site_url' => 'https://hdatmos.club',
            'api_url' => 'https://hdatmos.club/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '2xfree',
            'site_url' => 'https://pt.2xfree.org',
            'api_url' => 'https://pt.2xfree.org/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '明教',
            'site_url' => 'https://hdpt.xyz',
            'api_url' => 'https://hdpt.xyz/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => 'oshen',
            'site_url' => 'https://www.oshen.win',
            'api_url' => 'https://www.oshen.win/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '冬樱',
            'site_url' => 'https://wintersakura.net',
            'api_url' => 'https://wintersakura.net/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => 'rousi',
            'site_url' => 'https://rousi.zip',
            'api_url' => 'https://rousi.zip/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '咖啡',
            'site_url' => 'https://ptcafe.club',
            'api_url' => 'https://ptcafe.club/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '1ptba',
            'site_url' => 'https://1ptba.com',
            'api_url' => 'https://1ptba.com/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '农场',
            'site_url' => 'https://pt.0ff.cc',
            'api_url' => 'https://pt.0ff.cc/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '你堡',
            'site_url' => 'https://ubits.club',
            'api_url' => 'https://ubits.club/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => 'kufei',
            'site_url' => 'https://kufei.org',
            'api_url' => 'https://kufei.org/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => 'icc',
            'site_url' => 'https://www.icc2022.com',
            'api_url' => 'https://www.icc2022.com/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '憨憨',
            'site_url' => 'https://hhanclub.top',
            'api_url' => 'https://hhanclub.top/npapi/torrents/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => 'ptlsp',
            'site_url' => 'https://www.ptlsp.com',
            'api_url' => 'https://www.ptlsp.com/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => 'hdtime',
            'site_url' => 'https://hdtime.org',
            'api_url' => 'https://hdtime.org/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],[
            'site_name' => 'zmpt(织梦)',
            'site_url' => 'https://zmpt.cc',
            'api_url' => 'https://zmpt.cc/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => 'ultrahd',
            'site_url' => 'https://ultrahd.net',
            'api_url' => 'https://ultrahd.net/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '猪猪',
            'site_url' => 'https://piggo.me',
            'api_url' => 'https://api.piggo.me/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ],
          [
            'site_name' => '红叶',
            'site_url' => 'https://leaves.red',
            'api_url' => 'https://leaves.red/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
          ]
        ]
      );
    }
}
